<template>
  <a-card :bordered="false">
      <a-page-header
        style="border: 1px solid rgb(235, 237, 240)"
        title="前端推送资质配置"
        sub-title="目前支持个推·消息推送"
        @back="() => null"
      >
        <template slot="extra">
          <a-anchor :affix="true">
            <a-anchor-link :href="docUrl" target="_blank" title="接入文档" />
          </a-anchor>
        </template>
      </a-page-header>
    <a-row>
      <a-col :xs="{ span: 6, offset: 1 }" :lg="{ span: 6, offset: 1 }">
      <a-card hoverable>
        <img
          slot="cover"
          alt="example"
          :src="imgUrl.getuiimg"
          width="100%"
          height="100%"
        />
        <template slot="actions" class="ant-card-actions">
          <a-tooltip>
            <template slot="title">
              设置
            </template>
            <a-icon key="setting" type="setting" style="font-size: 20px;"
                    :spin="spin.getuiflg"
                    @mouseover="mouseOver(0)"
                    @mouseleave="mouseLeave(0)"
                    @click="goToGeTuiModal(false)"/>
          </a-tooltip>
          <a-tooltip>
            <template slot="title">
              详情
            </template>
            <a-icon key="search" type="search" style="font-size: 20px;" @click="goToGeTuiModal(true)"/>
          </a-tooltip>
        </template>
        <a-card-meta description="智能推送+场景推送，有效提升用户活跃度与粘性">
          <template slot="title">
            个推·消息推送
            <a-tag color="green"     v-if="configData.enable==true">
              运行
            </a-tag>
            <a-tag color="red" v-else>
              停止
            </a-tag>
          </template>
          <a-avatar
            slot="avatar"
            :src="imgUrl.getuiimg"
          />
        </a-card-meta>

      </a-card>
      </a-col>
      <getui-modal ref="geTuiRef"></getui-modal>
    </a-row>

  </a-card>
</template>

<script>
import {BoneCommonMixin} from "@/mixins/BoneCommonMixin";
import getuiimg from "./img/getui.jpg"
import wechatImg from "./img/wechat.jpg"
import smallwechatImg from "./img/small-wechat.jpg"
import {ConfigDictMixins} from "@views/gospel/configCenter/mixins/ConfigDictMixins";
import GetuiModal from "@views/gospel/configCenter/tippush/modules/GeTuiModal";


export default {
  name: "LogisticsConfig",
  mixins: [BoneCommonMixin, ConfigDictMixins],
  components: {GetuiModal},
  data() {
    return {
      description: "推送配置中心",
      imgUrl: {
        getuiimg: getuiimg,
        wechatimg: wechatImg,
        smallwechatimg: smallwechatImg
      },
      type: "tippushGetui",
      routerUrl: "/config/center/getuiconfig",
      docUrl:"http://doc.netmi.com.cn/web/#/page/40945",
      spin: {
        getuiflg: false,
      }
    }
  },
  created() {
    this.queryJsonDict();
  },
  methods: {
    goToGeTuiModal(value) {
      this.$refs.geTuiRef.visible = true;
      this.$refs.geTuiRef.disable = value;
      this.$refs.geTuiRef.queryJsonDict();
    },
    mouseOver: function (value) {
      switch (value) {
        case 0:
          this.spin.getuiflg = true;
          break;
      }
    },
    mouseLeave: function (value) {
      switch (value) {
        case 0:
          this.spin.getuiflg = false;
          break;

      }
    },
  }
}
</script>

<style scoped>

</style>